home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Epic Collection 3
/
Epic Collection 3, The (1997)(Epic Marketing)[!].iso
/
internet
/
ums
/
ums11.6
/
rexx
/
umsedit.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-09-08
|
1KB
|
45 lines
/* safely edit the UMS configuration-file */
/*** Init ***/
call addlib("rexxdossupport.library", 0, -30)
call addlib("ums.library", 0, -210, 11)
call UMSInitConsts()
/*** Arguments ***/
ProgramName = "UMSEdit";
ArgsTemplate = "SERVER"
args.SERVER = "default"
parse arg arguments
if strip(arguments) = '?' then do
call writech(STDOUT, ArgsTemplate || ': ')
arguments = readln(STDIN)
end; else nop
if ~ReadArgs(arguments,ArgsTemplate,"args.") then do
say Fault(RC, ProgramName)
exit 10
end; else nop
/*** look for server and dir ***/
dir = GetVar('umsmb.' || args.server)
if dir = "" then do
say "UMS-MB '" || args.server || "' does not exist"
end; else do
call pragma("D", dir)
/* try to lock the config */
res = UMSServerControl("LOCKCFG", args.server)
if res = 0 then do
say "editing config for MB '" || args.server || "' in" dir
address command "$EDITOR ums.config"
/* release the lock */
call UMSServerControl("UNLOCKCFG", args.server)
end; else do
say "UMS Error #" || res || ": " || UMSErrTxtFromNum(res)
end
end